package com.qf.dao;

import com.qf.pojo.Branch;
import com.qf.pojo.Item;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * @ClassName ItemDao
 * @Description TODO
 * @Author Windy
 * @Date 2022/8/25 14:32
 * @Version 1.0
 **/
public interface BranchDao {

    @Select("select * from branch where pid=#{pid} and status=1")
    List<Branch> findBranchsBypid(int pid);


//    一个开发部门对应多个计划
    @Select("select * from branch where pid=#{pid} and status=1")
    @Results(id = "taskMap",value = {
            @Result(column = "bid",property = "bid"),
            @Result(column = "bname",property = "bname"),
            @Result(column = "pid",property = "pid"),
            @Result(column = "updatetime",property = "updatetime"),
            @Result(column = "status",property = "status"),
            @Result(column = "bid",property = "taskPlans",
                    many = @Many(select = "com.qf.dao.TaskPlanDao.findTaskByBid")
            )
    })
    List<Branch> findBranchsAndTaskBypid(int pid);
}
